<?xml version="1.0"?> 
<project name="LEET Enhanced Exploratory Testing" default="cover">

  <property value="LEET\Tedds Tool" name="project" />
  <property value="L33T" name="hudsonProject" />

  <!-- Start by cleaning the build area -->
  <target name="clean" description="remove all build products" >
    <delete dir="TestResults" />
    <delete dir="build" />
    <exec
      executable="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
      failonerror="true">
	  <arg value="Tedds Tool.sln"/>
	  <arg value="/target:Clean"/>
	</exec>
  </target>

  <!-- Create a build area -->
  <target name="init" depends="clean">
    <mkdir dir="build"/>
  </target>
  
  <target name="compile" depends="init">
      <exec
      	executable="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\msbuild.exe"
      	failonerror="true">
		<arg value="Tedds Tool.sln"/>
	  </exec>
 </target>

 <target name="test" depends="compile">
  <delete dir="TestResults"/>
  <mkdir dir="TestResults"/>
  <exec
  	executable="C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe"
  	failonerror="true">
    <arg value="/testmetadata:Tedds Tool1.vsmdi"/>
	<arg value="/testlist:All"/>
	<arg value="/runconfig:TestRunConfig.testrunconfig"/>
	<arg value="/resultsfile:TestResults\testResults.trx"/>
  </exec>
 </target>

<target name="cover" depends="test">
  <exec executable="MSBuild">
    <arg value='/property:hudsonProjectRoot="C:\.hudson\jobs\${hudsonProject}\workspace\${project}" "C:\VSCodeCoverage\GenerateCoverage.build"' />
  </exec>

  <exec executable="C:\MsBuildNunit\msxsl.exe">
    <arg value="C:\.hudson\jobs\${hudsonProject}\workspace\${project}\TestResults\TestOut\In\ASEBEAST\data.xml" />
    <arg value="C:\VSCodeCoverage\MSTestCoverageToEmma.xsl"/>
    <arg value='-o'/>
    <arg value="C:\.hudson\jobs\${hudsonProject}\workspace\${project}\TestResults\coverage.xml"/>
    <!--C:\.hudson\jobs\L33T\workspace\LEET\Tedds Tool\TestResults\ASEBEAST\In\ASEBEAST-->
  </exec>
</target>

</project>
